import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from '../views/Home'
import Category from '../views/Category'
import GoodsList from '../views/GoodsList'
import GoodsDetail from '../views/GoodsDetail'
import Cart from '../views/Cart'
import User from '../views/User'
import Order from '../views/Order'
import Feedback from '../views/Feedback'
import Collect from '../views/Collect'
import Pay from '../views/Pay'
import Search from '../views/Search'

Vue.use(VueRouter)

const routes = [
  { path: '/', name: 'Home', component: Home },
  { path: '/category', name: 'Category', component: Category },
  { path: '/goodslist/:cid', name: 'GoodsList', component: GoodsList },
  { path: '/goodsdetail/:goods_id', name: 'GoodsDetail', component: GoodsDetail },
  { path: '/cart', name: 'Cart', component: Cart },
  { path: '/user', name: 'User', component: User },
  { path: '/order', name: 'Order', component: Order },
  { path: '/search', name: 'Search', component: Search },
  { path: '/pay', name: 'Pay', component: Pay },
  { path: '/collect', name: 'Collect', component: Collect },
  { path: '/feedback', name: 'Feedback', component: Feedback }

  // {
  //   path: '/feedback',
  //   name: 'Feedback',
  //   component: () => import(/* webpackChunkName: "Feedback" */ '../views/Feedback.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
